package com.ruoyi.sale.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sale.mapper.SalePayorderMapper;
import com.ruoyi.sale.domain.SalePayorder;
import com.ruoyi.sale.service.ISalePayorderService;

/**
 * 支付订单Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-02
 */
@Service
public class SalePayorderServiceImpl implements ISalePayorderService 
{
    @Autowired
    private SalePayorderMapper salePayorderMapper;

    /**
     * 查询支付订单
     * 
     * @param id 支付订单主键
     * @return 支付订单
     */
    @Override
    public SalePayorder selectSalePayorderById(Integer id)
    {
        return salePayorderMapper.selectSalePayorderById(id);
    }

    /**
     * 查询支付订单列表
     * 
     * @param salePayorder 支付订单
     * @return 支付订单
     */
    @Override
    public List<SalePayorder> selectSalePayorderList(SalePayorder salePayorder)
    {
        return salePayorderMapper.selectSalePayorderList(salePayorder);
    }

    /**
     * 新增支付订单
     * 
     * @param salePayorder 支付订单
     * @return 结果
     */
    @Override
    public int insertSalePayorder(SalePayorder salePayorder)
    {
        salePayorder.setCreateTime(DateUtils.getNowDate());
        return salePayorderMapper.insertSalePayorder(salePayorder);
    }

    /**
     * 修改支付订单
     * 
     * @param salePayorder 支付订单
     * @return 结果
     */
    @Override
    public int updateSalePayorder(SalePayorder salePayorder)
    {
        return salePayorderMapper.updateSalePayorder(salePayorder);
    }

    /**
     * 批量删除支付订单
     * 
     * @param ids 需要删除的支付订单主键
     * @return 结果
     */
    @Override
    public int deleteSalePayorderByIds(Integer[] ids)
    {
        return salePayorderMapper.deleteSalePayorderByIds(ids);
    }

    /**
     * 删除支付订单信息
     * 
     * @param id 支付订单主键
     * @return 结果
     */
    @Override
    public int deleteSalePayorderById(Integer id)
    {
        return salePayorderMapper.deleteSalePayorderById(id);
    }
}
